home *** CD-ROM | disk | FTP | other *** search
- #include "dos.h"
- #include "stdlib.h"
- #include "windows.h"
-
- void spycls(void);
- void init(void);
- void spystr(char *,char,char);
- void spytoa(int,char,char);
- void spyarr(char,int,char,char);
-
- struct {char car,att;} (far *Video)[25][80] ;
-
- #define CAR(LGN,COL) ((*Video)[LGN][COL].car)
- #define ATT(LGN,COL) ((*Video)[LGN][COL].att)
-
-
- void spycls()
- {
- int i,j;
- init();
- for (i=0;i<25;i++)
- {
- for (j=0;j<80;j++)
- {
- CAR(i,j)=' ';
- ATT(i,j)=0;
- }
- }
- }
-
- void spystr(char *string,char l,char c)
- {
- init();
- while(*string)
- {
- CAR(l,c) = *string;
- ATT(l,c) = 0x07;
- if (++c > 79) c = 0;
- if (c == 0)
- if (++l >24)
- {
- spycls();
- l=0;
- }
- string ++;
- }
- }
-
- void spytoa(int x,char l,char c)
- {
- char *string;
- init();
- string=(char *)LocalAlloc(LPTR,10);
- itoa(x,string,10);
- while(*string)
- {
- CAR(l,c) = *string;
- ATT(l,c) = 0x0F;
- if (++c > 79) c = 0;
- if (c == 0)
- if (++l >24)
- {
- spycls();
- l=0;
- }
- string ++;
- }
- LocalFree((HANDLE)string);
- }
-
-
- void init()
- {
- FP_SEG(Video) = 0xB000;
- FP_OFF(Video) = 0x0000;
- }
-